import httpRequest from "~/config/requet";

// 平台用户详情
export const GetPlatformUserDetail = (params) => {
  return httpRequest.getServer("/admin-api/biz/bizUser/detail", params);
};

// 更新平台用户信息
export const UpdatePlatformUser = (data) => {
  return httpRequest.putServer("/admin-api/biz/bizUser/update", data);
};

// 我的课程列表
export const GetCourseListOfMy = (params) => {
  return httpRequest.getClient("/admin-api/biz/course-student/list", params);
};

// 课程学员上课记录分页
export const GetCourseStudentClassRecordPage = (params) => {
  return httpRequest.getClient(
    "/admin-api/biz/course-student-class-record/page",
    params
  );
};

// 我的课程列表
export const GetCourseTabsOfMy = (params) => {
  return httpRequest.getClient(
    "/admin-api/biz/course-student/schoolTimetable",
    params
  );
};

// 企业官网-课程表
export const GetSchoolTimetable = (params) => {
  return httpRequest.postClient(
    "/admin-api/biz/course-student/schoolTimetable",
    params
  );
};

// 企业官网-课程表日历
export const GetAppointmentCalendar = (params) => {
  return httpRequest.postClient(
    "/admin-api/biz/course-student/appointmentCalendar",
    params
  );
};

// 课程订单分页
export const GetCourseOrderPage = (params) => {
  return httpRequest.getClient("/admin-api/biz/course-order/page", params);
};

// 课程订单支付
export const PayCourseOrder = (data) => {
  return httpRequest.postClient("/admin-api/biz/course-order/pay", data);
};

// 上传课程订单支付凭证
export const UploadCourseOrder = (formData) => {
  return httpRequest.postClient("/admin-api/biz/course-order/upload", formData);
};

// 课程订单取消
export const CancelCourseOrder = (id) => {
  return httpRequest.postClient(`/admin-api/biz/course-order/cancel/${id}`);
};

// 学生预约/请假/签到及取消
export const ReservationOrLeaveOrSignIn = (params) => {
  return httpRequest.postClient(
    "/admin-api/biz/course-schedules-student/reservationOrLeaveOrSignIn",
    params
  );
};
